package service.impl;

import dao.StaffDao;
import entity.Staff;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import service.StaffService;

import java.util.List;

@Service()
@Transactional(propagation = Propagation.REQUIRED)
public class StaffServiceImpl implements StaffService {

    @Autowired
    private StaffDao staffDao;

    @Override
    public List<Staff> getstaffs(Staff staff) {
        return staffDao.getstaffs(staff);
    }

    @Override
    public Integer addstaff(Staff staff) {
        return staffDao.addstaff(staff);
    }

    @Override
    public Integer delstaff(Integer staffid) {
        return staffDao.delstaff(staffid);
    }

    @Override
    public Staff getStaffById(Integer staffid) {
        return staffDao.getStaffById(staffid);
    }

    @Override
    public Integer updateStaff(Staff staff) {
        return staffDao.updateStaff(staff);
    }


}
